package com.instpower.things.config;

/**
 * @ClassName Handlers
 * @Author: hellmash@gmail.com
 * @Date: 2020/2/26
 * @Version: 1.0.0
 * @Description: 指令集
 */
public class Configs {

    /**
     * 电池详情缓存
     */
    public static final String BATTERY_HASHKEY     = "BATTERY_HASHKEY";


    /**
     * 归还电池
     */
    public static final String BATTERT_RETURN_PREF = "BATTERT_RETURN_";

    /**
     * 机柜重启指令保存的key
     */
    public static final String CMD_REBOOT_KEY_PREF = "CMD_REBOOT_%s";

    /**
     * 组借指令执行状态缓存
     */
    public static final String RENT_ORDER_KEY_PREF = "RENT_ORDER_%S";

    /**
     * 08F6执行完成标志
     */
    public static final String RENT_08F6_FINISH    = "RENT_08F6_FINISH_%s";


    /**
     * 08F6指令是否有回复缓存数据
     */
    public static final String RENT_08F6_KEY_PREF = "RENT_08F6_%s";

    /**
     * ota当个升级hashkey
     */
    public static final String OTA_SINGLE_KEY       = "OTA_SIGNLE";

    /**
     * OTA批量升级
     */
    public static final String OTA_BATCG_KEY        = "OTA_BATCH";

    /**
     * 设备状态记录周期
     */
    public static final int BEAT_CYCLE          = 60;

    /**
     * 电池柜redis失效时间(单位分钟)
     */
    public static final int CABINET_TIMEOUT         = 5;

    /**
     * 08F6轮询间隔时间,毫秒
     */
    public static final int RENT_RETRY_TIME         = 15000;

    /**
     * 登录信息
     */
    public static final short LOGIN                = 0x0901;

    /**
     * 心跳
     */
    public static final short BEAT                 = 0x0902;

    /**
     * 被动上报机柜状态
     */
    public static final short STATUS               = 0x08F6;

    /**
     * 借设备
     */
    public static final short RENT                 = 0x08F5;

    /**
     * 交易
     */
    public static final short ORDER                = 0x09D9;

    /**
     * 读取BS协议通信参数
     */
    public static final short PROTO_ARGS            = 0x0008;

    /**
     * 升级握手
     */
    public static final short UPDATE_START          = 0x0F01;

    /**
     * 固件更新指令
     */
    public static final short UPDATE_CMD            = 0x0F05;

    /**
     * 强制重启设备
     */
    public static final short REBOOT_CMD            = 0x08A6;

    /**
     * 设置远程服务器IP和端口
     */
    public static final short HOST_CMD              = 0x0084;

    /**
     * 缓存借还订单BSN
     */
    public static final String PREFIX_BSN           = "BSN_%s_%d";

    public static final String ANKER_RENT_RETURN_ORDER_NO  = "ANKER_RENT_RETURN_ORDER_NO_%s";
}
